package 创建对象;

public class Main {
    public static void main(String[] args) {

        String s1 = "我爱你中国";
        System.out.println(s1);

        String s2 = new String();
        System.out.println(s2);

        String s3 = new String("我是中国人");
        System.out.println(s3);

        char[] chars = {'a','b','c','中','国'};
        String s4 = new String(chars);
        System.out.println(s4);

        byte[] bytes = {97,98,99,65,66,67};
        String s5 = new String(bytes);
        System.out.println(s5);

        String s11 = "abc";
        String s22 = "abc";
        System.out.println(s11==s22);

        char[] chars1 = {'a','b','c'};
        String s111 = new String(chars1);//new 开辟一块新的内存空间
        String s222 = new String(chars1);
        System.out.println(s111==s222);
    }
}
